package com.hq.pool;

import org.junit.Test;

public class ReentrantLockTest {
    public static  synchronized void getName(){
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        getAge();
        System.out.println("getNmae结束");
    }

    public static  synchronized void getAge(){
        System.out.println("age是19");
    }

    @Test
    public void test(){
        getName();
    }
}
